package com.meida.module.bus.client.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 支付类型
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum PayParamCodeEnum {
    xunLian("xunLian", "讯联支付"),
    yinLian("yinLian", "银联支付");

    PayParamCodeEnum(String payParamCode, String desc) {
        this.payParamCode = payParamCode;
        this.desc = desc;
    }

    @EnumValue
    private final String payParamCode;
    private final String desc;

    public String getPayParamCode() {
        return payParamCode;
    }

    public String getDesc() {
        return desc;
    }

    public static PayParamCodeEnum getByValue(String code) {
        for (PayParamCodeEnum payParamCodeEnum : values()) {
            if (code.equals(payParamCodeEnum.getPayParamCode())) {
                return payParamCodeEnum;
            }
        }
        return null;
    }
}
